package com.hans.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.Window;

/**
 * Created by Administrator on 2016/6/15.
 */
public class CustomDialog extends Dialog {
    private View layoutView;
    protected Context context;

    public CustomDialog(Context context) {
        super(context,android.R.style.Theme_Dialog);
    }

    public CustomDialog(Context context, int layoutResId) {
        this(context);
        this.context=context;
        getWindow().requestFeature(Window.FEATURE_NO_TITLE);
        getWindow().setBackgroundDrawableResource(android.R.color.transparent);
        layoutView=View.inflate(context,layoutResId,null);
        setContentView(layoutView);

    }

    public View findViewById(int id){
        if(layoutView==null) return super.findViewById(id);
        else return layoutView.findViewById(id);
    }


}
